[Flyout] use container as reference for pushMinBreakpoint#9592
[Flyout] use container as reference for pushMinBreakpoint#9592tsullivan merged 14 commits intoelastic:mainfrom
Conversation
There was a problem hiding this comment.
Pull request overview
Fixes EuiFlyout’s pushMinBreakpoint behavior so that when a container is provided, the decision to render in “push” vs “overlay” mode is based on the container width (not the viewport), aligning responsive behavior with the available in-container space.
Changes:
- Updated
useIsPushedto optionally compute breakpoint logic against a provided container element’s width (viaResizeObserver+ theme breakpoints). - Wired
containerElementintouseIsPushedfrom both unmanaged (EuiFlyoutComponent) and managed (EuiFlyoutMain) flyout entry points. - Added an upcoming changelog entry documenting the bug fix.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| packages/eui/src/components/flyout/manager/flyout_main.tsx | Uses manager container state as the reference for pushMinBreakpoint decisions in the managed main flyout wrapper. |
| packages/eui/src/components/flyout/hooks.ts | Extends useIsPushed to support container-width-based breakpoint evaluation and react to container resizes. |
| packages/eui/src/components/flyout/flyout.component.tsx | Passes the resolved flyout container element into useIsPushed so push/overlay behavior matches container sizing. |
| packages/eui/changelogs/upcoming/9592.md | Documents the pushMinBreakpoint container-scoped bug fix. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…h already computed by useApplyFlyoutLayoutMode
acstll
left a comment
There was a problem hiding this comment.
Thanks for opening this @tsullivan! I left a couple of comments, nothing blocking.
I also have another suggestion: do you think it'd make sense to define the container prop in the flyout_manager.stories.tsx? I added it locally (here) for testing like in the snippet below (maybe there's a more correct way i'm missing):
container={() => document.querySelector('#app-main-scroll')}
Thanks for this suggestion, @acstll! There actually is a "Container demo" storybook in
I think we can eventually get rid of the storybooks from (2) and maybe (3):
|
…com:tsullivan/eui into flyout/container-prop-and-pushMinBreakpoint
💚 Build SucceededHistory
|
💚 Build Succeeded
History
|
acstll
left a comment
There was a problem hiding this comment.
🟢 Thanks for addressing the feedback and for contributing the fix!
thanks for the detailed explanation @tsullivan — i don't have a strong opinion, but i do agree removing them for the reasons you're outlining seems like the right move 👍 the "container demo" was useful for me in this case, it allowed me to test the changes locally without using Kibana 😅 |
## Dependency updates - `@elastic/eui` - v114.2.0 ⏩ v114.3.0 --- ## Package updates ## [`v114.3.0`](https://github.com/elastic/eui/releases/v114.3.0) - Updated `productDashboard` icon. ([#9607](elastic/eui#9607)) - Updated `EuiStepsHorizontal` to prevent steps being clickable when `status="disabled"` ([#9574](elastic/eui#9574)) **Bug fixes** - Fixed broken SVG for `chartPie` icon. ([#9607](elastic/eui#9607)) - Fixed a bug in `EuiDataGrid` that caused the scroll position to reset when using middle mouse button to scroll the container. ([#9613](elastic/eui#9613)) - Fixed `EuiFlyout` to compare `pushMinBreakpoint` against the container's width, instead of the viewport width, when the `container` prop is provided. This ensures app-scoped flyouts switch between push and overlay modes based on the space actually available inside their container. ([#9592](elastic/eui#9592)) **Accessibility** - Fixed duplicate screen reader output for `EuiStepsHorizontal` ([#9574](elastic/eui#9574))
Summary
Bug fix for EuiFlyout
pushMinBreakpointwhencontainerprop is provided.Addresses elastic/kibana#258828
Fix: "push" type
EuiFlyouthaspushMinBreakpointlogic. This changes the type tooverlaywhen the viewport size is below a given breakpoint. Typically, that breakpoint is measured against the browser viewport. When thecontainerprop is passed toEuiFlyout, the breakpoint should be measured against the dimensions of the given container.API Changes
containeris set, the push/overlay breakpoint decision is now based on the container's width instead of the viewport widthScreenshots
Setup:
resizable:falseownFocus:truetype:pushpushMinBreakpoint:mBefore
After
Impact Assessment
Note: Most PRs should be tested in Kibana to help gauge their Impact before merging.
[ ] 🔴 Breaking changes — What will break? How many usages in Kibana/Cloud UI are impacted?[ ] 🧪 Test impact — May break functional or snapshot tests (e.g., HTML structure, class names, default values).[ ] 🔧 Hard to integrate — If changes require substantial updates to Kibana, please stage the changes and link them here.Impact level: 🟢 None / 🟢 Low / 🟡 Moderate / 🔴 High
Impact explained: When a flyout has both type="push" and a container, the point at which it flips between push and overlay mode changes. Previously it was based on viewport width; now it's based on container width. Since containers are typically narrower than the viewport, the flyout will switch to overlay sooner (at wider viewport sizes) than before.
Release Readiness
[ ] Documentation: {link to docs page(s)}[ ] Figma: {link to Figma or issue}[ ] Migration guide: {steps or link, for breaking/visual changes or deprecations}[ ] Adoption plan (new features): {link to issue/doc or outline who will integrate this and where}QA instructions for reviewer
Checklist before marking Ready for Review
breaking changelabel (if applicable)Reviewer checklist